FROM reg.xthklocal.cn/xthk-library/node:20.9.0-debian11 as builder
WORKDIR /app
COPY ./package.json ./package-lock.json ./
RUN npm config set registry https://registry.npmmirror.com && yarn install
COPY . .
RUN npm run build

FROM reg.xthklocal.cn/xthk-library/nginx:1.16.0
COPY --from=builder /app/dist $XTHK_CODE_ROOT
#ENV XTHK_CODE_SOURCE=./dist
#COPY $XTHK_CODE_SOURCE $XTHK_CODE_ROOT
WORKDIR /var/www/code/app
